import { request } from '../configs';
import makeApi from './index';


const defaultData = {
	query: {
		searchCount: true,
		openSort: true,
		isAsc: false,
		orderByField: 'utime',
		size: 1000
	}
};

export const api = {
	query: '/sys/sysRole/getListByPage',
	create: '/sys/sysRole/add',
	update: '/sys/sysRole/update',
	remove: '/sys/sysRole/delete',
	getDetail: '/sys/sysRole/detail'
};

const services = makeApi(api);
services.query = function query(params) {
	return request({
		url: api.query,
		method: 'post',
		data: params || defaultData.query,
	});
};

const {
	query,
	create,
	update,
	remove,
	getDetail,
} = services;

export {
	query,
	create,
	update,
	remove,
	getDetail,
};
export default services;
